package com.infinit.easyreader.entity;

/**
 * 类：com.infinit.easyreader.entity V[1.0.0]
 * 作用：用于描述当前的阅读信息的实体
 * Created by rzy on 2016/3/12.
 */
public class ReadInfo {

    public static ReadInfo info = null;
    //阅读的起始位置
    private long readStartPosition;
    //当前页面的大小
    private long pageSize;
    //阅读到位置
    private long readEndPosition;
    //阅读详情
    private String readDetail;
    //是否终止
    private boolean isEOF;

    private ReadInfo() {
    }

    /**
     * 作用：使用singleton来获取一个当前类的实例
     *
     * @return 当前readInfo的一个实例
     */
    public static ReadInfo newInsatance() {


        if (info == null) {
            synchronized (ReadInfo.class) {
                if (info == null) {
                    return new ReadInfo();
                }
                return info;
            }

        }
        return info;


    }

    public boolean isEOF() {
        return isEOF;
    }

    public void setIsEOF(boolean isEOF) {
        this.isEOF = isEOF;
    }

    public long getReadStartPosition() {
        return readStartPosition;
    }

    public void setReadStartPosition(long readStartPosition) {
        this.readStartPosition = readStartPosition;
    }

    public long getPageSize() {
        return pageSize;
    }

    public void setPageSize(long pageSize) {
        this.pageSize = pageSize;
    }

    public long getReadEndPosition() {
        return readEndPosition;
    }

    public void setReadEndPosition(long readEndPosition) {
        this.readEndPosition = readEndPosition;
    }


    public String getReadDetail() {
        return readDetail;
    }

    public void setReadDetail(String readDetail) {
        this.readDetail = readDetail;
    }

}
